*** Do File for POQ Paper ***

*****************************************************************************************************************************************************************************************************************************************************

** Table 1 **
clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Cumulative ANES 1948 to 2020 (POQ Final).dta"

svyset [pweight=Weight]

svy: tab Vote_President if Union_Member==1 & Mode==0 & (Year>=1952 & Year<=2012)

clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Cumulative CES 2006 to 2023 (POQ Final).dta"

svyset [pweight=Weight]

svy: tab Vote_President if Union_Member==1 & Valid_Voter==1 & (Year==2016 | Year==2020)

** Table 2 **
clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Annenberg 2004 (POQ Final).dta"

probit Combo_Intend_Bush_over_Kerry Ever_Discuss_Politics_Work Part_Time i.Sector3 Female White College Married Age Over_50K_Income Born_Again Residence_Over_Year Urban_Area Military_HH Gun_HH Other_Union_HH Unemployed_HH ///
RTW Swing_State Interviewed_Post_Edwards_VP if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), r
outreg2 using tab.tex, dec(3) replace sideway noaster stats(coef se pval) addstat(Pseudo R2, e(r2_p))

** Figure 1 **
clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Annenberg 2004 (POQ Final).dta"

probit Combo_Intend_Bush_over_Kerry i.Frequency_Discuss_Politics_Work Part_Time i.Sector3 Female White College Married Age Over_50K_Income Born_Again Residence_Over_Year Urban_Area Military_HH Gun_HH Other_Union_HH Unemployed_HH ///
RTW Swing_State Interviewed_Post_Edwards_VP if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), r
margins, at(Frequency_Discuss_Politics_Work=(0 1 2))
marginsplot

** Figure 2 **
clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Annenberg 2004 (POQ Final).dta"

probit Combo_Intend_Bush_over_Kerry c.Ever_Discuss_Politics_Work##c.Swing_State i.Sector3 Female White College Married Age Over_50K_Income Born_Again Residence_Over_Year Urban_Area Military_HH Gun_HH Other_Union_HH Unemployed_HH ///
RTW Interviewed_Post_Edwards_VP if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), r
margins, dydx(Ever_Discuss_Politics_Work) at(Swing_State=(0(1)1))
marginsplot

** Figure 3 **
clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Annenberg 2004 (POQ Final).dta"

probit Combo_Intend_Bush_over_Kerry c.Ever_Discuss_Politics_Work##i.Sector3 Female White College Married Age Over_50K_Income Born_Again Residence_Over_Year Urban_Area Military_HH Gun_HH Other_Union_HH Unemployed_HH ///
RTW Swing_State Interviewed_Post_Edwards_VP if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), r
margins, dydx(Ever_Discuss_Politics_Work) at(Sector3=(1 2 3))
marginsplot

** Table 3 **
clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Annenberg 2004 (POQ Final).dta"

probit Combo_Intend_Bush_over_Kerry Ever_Discuss_Politics_Work Part_Time i.Sector3 Female White College Married Age Over_50K_Income Born_Again Residence_Over_Year Urban_Area Military_HH Gun_HH Other_Union_HH Unemployed_HH ///
RTW Swing_State Interviewed_Post_Edwards_VP if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), r
outreg2 using tab.tex, dec(3) replace noaster stats(coef se pval) addstat(Pseudo R2, e(r2_p))

probit Combo_Intend_Bush_over_Kerry Ever_Discuss_Politics_Work Part_Time i.Sector3 Female White College Married Age Over_50K_Income Born_Again Residence_Over_Year Urban_Area Military_HH Gun_HH Other_Union_HH Unemployed_HH ///
RTW Swing_State Interviewed_Post_Edwards_VP Democrat Liberal if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), r
outreg2 using tab.tex, dec(3) append noaster stats(coef se pval) addstat(Pseudo R2, e(r2_p))

** Table 4 **
clear
use "C:\Users\David Macdonald\Dropbox\Final POQ Union Member Voting\Clean Annenberg 2004 (POQ Final).dta"

mean Labor_Unions_Favorability01 if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101) & Ever_Discuss_Politics_Work==0  
mean Labor_Unions_Favorability01 if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101) & Ever_Discuss_Politics_Work==1  

mean Combo_Know_Union_Organizing if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101) & Ever_Discuss_Politics_Work==0  
mean Combo_Know_Union_Organizing if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101) & Ever_Discuss_Politics_Work==1  

ttest Labor_Unions_Favorability01 if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), by(Ever_Discuss_Politics_Work)
ttest Combo_Know_Union_Organizing if Union_Member==1 & Employed==1 & (Date_of_Interview>=20040128 & Date_of_Interview<=20041101), by(Ever_Discuss_Politics_Work)


